/* 
 * File:   Aplicacao.hpp
 * Author: Ana Paula
 *
 * Created on 11 de Julho de 2011, 14:22
 */

#ifndef APLICACAO_HPP
#define	APLICACAO_HPP

#include <list>
#include "Layer.hpp"
#include <boost/thread.hpp>

using namespace ufpb::project::network;

class Aplicacao : public Layer {

    public:

        Aplicacao();

        virtual ~Aplicacao();

        void escreve(Bits* data);

        Bits* le(void);
    private:

        void newReceivedMessage(Bits* data);
        void newMessageToSend(Bits* data);
        std::list<Bits*>* bufferLe;
        boost::mutex bufferLeLock;
		boost::mutex condm;
        boost::condition_variable le_cond;
};

#endif	/* APLICACAO_HPP */

